Create test issue and merge via GitHub#6
Conversation
Remove issue opening trigger from claude.yml to avoid conflicts with spec-to-code.yml workflow. Now Claude Code only triggers on comments, enabling clean approved workflow: 1. Create issue without @claude 2. Add 'approved' label 3. spec-to-code.yml posts @claude comment 4. claude.yml triggers on comment (not on issue opening) This prevents the issue where Claude Code would trigger twice for the same issue and ignore the second trigger.
Code Review: Workflow Trigger CleanupSummaryThis PR removes the ✅ Strengths
📋 Code Quality AssessmentBest Practices: ✅ Excellent
Potential Bugs: ✅ None identified
Performance: ✅ Improved
Security: ✅ No concerns
🔍 Detailed AnalysisBefore (Problems)on:
issues:
types: [opened, assigned] # ⚠️ Could trigger twice for same issueScenario:
After (Fixed)on:
issue_comment:
types: [created] # ✅ Only responds to commentsNew Flow:
🎯 Recommendations1. Update Documentation (Optional but Recommended)The change alters the workflow described in # Before
Person->>Issues: Create issue with @claude
Issues->>GHA: Trigger claude.yml
# After
Person->>Issues: Create issue (no @claude needed)
Person->>Issues: Add label "approved"
Issues->>GHA: Trigger spec-to-code.yml
GHA->>Issues: Post @claude comment
Issues->>GHA: Trigger claude.yml2. Consider Adding Workflow Dispatch (Future Enhancement)For debugging/testing, you might want to add manual trigger capability: on:
workflow_dispatch:
inputs:
issue_number:
description: 'Issue number to process'
required: trueThis would allow manual testing without creating real issues. 3. Test CoverageSince this is a workflow configuration change, consider testing:
📊 Test CoverageN/A - GitHub Actions workflow configuration (no unit tests applicable) 🎉 VerdictAPPROVED ✅ This is a clean, focused fix that:
The PR description clearly explains the problem and solution. The implementation is correct and minimal. 💡 Minor Suggestions
Great work on identifying and fixing this workflow conflict! 🚀 |
Updated spec-to-code and quality-check workflow documentation to show the new implementation using Claude Code Action instead of direct API calls. Changes: - spec-to-code.yml now posts @claude comment instead of calling API - quality-check.yml now posts @claude comment instead of calling API - claude.yml executes both workflows via anthropics/claude-code-action - Added note about live visibility in Claude Code Web - Added CLAUDE_CODE_OAUTH_TOKEN requirement This reflects the actual implementation after the refactoring to make workflows visible and trackable in Claude Code Web.
Code Review - PR #6OverviewThis PR removes the ✅ Strengths
🔍 Observations & Recommendations1. Workflow Trigger Logic (.github/workflows/claude.yml:13-16)The conditional logic is clean and well-structured: if: |
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude'))Consideration: The Current behavior is probably correct - requiring exact 2. Edge Case: Manual Issue Creation with @claudeWith the removal of
Potential edge case: What if someone manually creates an issue with
This is the correct behavior and the PR solves it properly. 3. Documentation Accuracy (docs/architecture/automation-workflows.md:55-58)The documentation states: This is accurate based on 4. Missing Error Handling DocumentationThe workflow file **Error Handling**:
- If spec ID cannot be extracted → workflow fails with helpful error message
- If spec file doesn't exist → warning posted, but workflow continues (allows Claude to create the spec from issue body)5. Security Considerations ✅The workflow permissions are appropriately scoped: permissions:
contents: write # Allow commits
pull-requests: write # Allow PR creation
issues: write # Allow issue comments
id-token: write
actions: read # Required for Claude to read CI resultsNo security concerns identified. 6. Quality Check Workflow DocumentationThe documentation also updates the quality-check workflow to follow the same pattern (docs/architecture/automation-workflows.md:193-216). This is good for consistency, but I don't see the corresponding Question: Is 🐛 Potential IssuesNone identified - The code changes are minimal, focused, and solve the stated problem. ⚡ Performance ConsiderationsPositive impact: By eliminating double-triggers, this reduces:
🧪 Test CoverageNot applicable - This PR modifies GitHub Actions workflows and documentation, which are not covered by pytest. Recommendation: After merging, manually test the workflow:
📝 Minor Documentation Suggestions
✅ VerdictAPPROVED - This is a well-thought-out change that solves a real problem with minimal risk. The documentation is excellent and the code changes are surgical. Merge Confidence: High ✅ Suggested Next Steps (Optional)
Great work on improving the automation workflow! This is exactly the kind of proactive improvement that keeps the system maintainable. 🚀 |
There was a problem hiding this comment.
Pull request overview
This PR refactors the Claude Code automation workflow to prevent duplicate triggers by removing direct issue opening events from claude.yml. The new architecture uses a two-stage approach where spec-to-code.yml posts an @claude comment, which then triggers claude.yml via comment events only.
- Removed
issues: types: [opened, assigned]trigger fromclaude.ymlto avoid race conditions - Updated documentation to reflect the new two-workflow architecture for code generation and quality checks
- Clarified the orchestration pattern where trigger workflows post
@claudecomments
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
.github/workflows/claude.yml |
Removed issue opening trigger and corresponding condition check, now only triggers on comment events |
docs/architecture/automation-workflows.md |
Updated documentation to explain the two-workflow architecture (spec-to-code.yml + claude.yml, quality-check.yml + claude.yml) and their interaction via @claude comments |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
| spec_id: | ||
| required: true | ||
| workflow_run: | ||
| workflows: ["Test and Preview"] |
There was a problem hiding this comment.
The workflow name reference is incorrect. The documentation references "Test and Preview" but the actual workflow in .github/workflows/test-and-preview.yml is named "Test and Generate Previews". This should be updated to match the actual workflow name to ensure the workflow_run trigger works correctly.
| workflows: ["Test and Preview"] | |
| workflows: ["Test and Generate Previews"] |
…erge-01D6cfGXen5SRMqh8Xgf7iUn Create test issue and merge via GitHub
Medium Priority Tasks (#6 & #7): Integration Tests: - Add aiosqlite dependency for async SQLite testing - Create comprehensive test database fixtures with sample data - Add integration tests for all repository CRUD operations - Add E2E integration tests for all API endpoints - Test full stack with real database and async operations Error Handling Standardization: - Create api/exceptions.py with standardized error types - Add custom exceptions: PyplotsException, ResourceNotFoundError, DatabaseNotConfiguredError, ExternalServiceError, ValidationError - Register global exception handlers in api/main.py - Update all routers to use standardized exceptions - Replace 14+ HTTPException raises with consistent error helpers - Provide uniform error response format across API Testing: - 180+ test cases covering repositories and API endpoints - Full coverage of CRUD operations with real database - Async test fixtures for database setup and teardown Benefits: - Consistent error messages and HTTP status codes - Better error tracking and debugging - Comprehensive integration test coverage - Improved API reliability and user experience
Medium Priority Tasks (#6 & #7): Integration Tests: - Add aiosqlite dependency for async SQLite testing - Create comprehensive test database fixtures with sample data - Add integration tests for all repository CRUD operations - Add E2E integration tests for all API endpoints - Test full stack with real database and async operations Error Handling Standardization: - Create api/exceptions.py with standardized error types - Add custom exceptions: PyplotsException, ResourceNotFoundError, DatabaseNotConfiguredError, ExternalServiceError, ValidationError - Register global exception handlers in api/main.py - Update all routers to use standardized exceptions - Replace 14+ HTTPException raises with consistent error helpers - Provide uniform error response format across API Testing: - 180+ test cases covering repositories and API endpoints - Full coverage of CRUD operations with real database - Async test fixtures for database setup and teardown Benefits: - Consistent error messages and HTTP status codes - Better error tracking and debugging - Comprehensive integration test coverage - Improved API reliability and user experience
Critical fixes: - Fix TypeError: flatten tag dict to list for repository call (#6) Changed search_by_tags to receive list[str] instead of dict[str, list[str]] Repository expects flat list of tag values, not nested dict - Add missing dataprep and styling parameters (#1, #7) Added to search_specs_by_tags function signature and docstring These categories were documented but not implemented - Add filter logic for dataprep and styling (#2) Implemented filtering checks similar to other impl-level tags Ensures new parameters actually filter results - Update condition to include dataprep and styling (#3) Modified impl-level filtering condition on line 117 Now checks all 6 impl-level tag categories Improvements: - Add database error handling with helpful messages (#8) Check is_db_configured() before all database operations Provides clear error message if DATABASE_URL not set - Update test mocks to match fixed interface (#5) Tests now verify flattened tag list instead of dict Added new test for dataprep/styling filter parameters Mock is_db_configured to return True in test fixture Verification: - All 16 unit tests passing - Ruff linting and formatting applied - No routing conflicts (#4 verified - no /mcp routes in routers) Related: PR #4132, Issue #4129
Remove issue opening trigger from claude.yml to avoid conflicts with spec-to-code.yml workflow. Now Claude Code only triggers on comments, enabling clean approved workflow:
This prevents the issue where Claude Code would trigger twice for the same issue and ignore the second trigger.